/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
 * invulgotracker
 * Copyright (C) Thomas Andersen 2011 <thomas.1.andersen@gmail.com>
 * 
 * invulgotracker is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * invulgotracker is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#include <config.h>
#include <glade/glade.h>

#include "about.h"

#include "invulgotrackerapp.h"


extern "C" gboolean on_dialogAbout_delete_event(GtkWidget *widget, GdkEvent *event, gpointer user_data)
{
	gtk_dialog_response(GTK_DIALOG(widget), GTK_RESPONSE_CANCEL);
	return TRUE;
}

extern "C" void on_about_response(GtkDialog *dialog, gint response_id, gpointer user_data)
{
    ((About *)user_data)->Response(response_id);
}


About::About()
{
    window = NULL;
}

About::~About()
{
    if (window) {
        g_signal_handler_disconnect(window, responseHandler);
        gtk_widget_hide(window);
        window = NULL;
    }
}



void About::Show()
{
    window = glade_xml_get_widget (InvulgoTrackerApp::gxml, "dialogAbout");
    responseHandler = g_signal_connect(window, "response", (GCallback) on_about_response, this);
    gtk_widget_show(window);
}

void About::Response(gint responseId)
{
    if (responseId == GTK_RESPONSE_OK) {
    }
    delete this;
}


